home *** CD-ROM | disk | FTP | other *** search
Wrap
{ "schema": { "Code Name": "Text (50)", "Declerations": "Memo/Hyperlink (255)", "Code": "Memo/Hyperlink (255)", "Description": "Memo/Hyperlink (255)" }, "data": [ { "Code Name": "Database Add Record", "Code": "Data1.Recordset.AddNew", "Description": "Allows the user to add a new record" }, { "Code Name": "Database Save Record", "Code": "Data1.Recordset.Update" }, { "Code Name": "Database Delete Record", "Code": "Data1.Recordset.Delete: Data1.Recordset.MoveNext" }, { "Code Name": "Cut", "Code": "Clipboard.Clear: Clipboard.SetText Screen.ActiveControl.SelText: Screen.ActiveControl.SelText = \"\"" }, { "Code Name": "Copy", "Code": "Clipboard.Clear: Clipboard.SetText Screen.ActiveControl.SelText" }, { "Code Name": "Load a Shell Program", "Code": "Dim H%: H% = Shell(\"winhelp.exe vbcode.hlp\", 1)" }, { "Code Name": "Button Bar Cases", "Code": "Select Case Button Case 0: mnuNew_Click\r\n Case 1: mnuSave_Click\r\n Case 2: mnuCut_Click\r\n Case 3: mnuCopy_Click\r\n Case 4: mnuPaste_Click\r\n Case 5: mnuNew_Click\r\n Case 6: mnuDelete_Click\r\n Case 7: mnuContents_Click\r\n End Select" }, { "Code Name": "To Play WAV Files", "Declerations": "Declare function sndPlaySound Lib \"MMSYSTEM\" (byval lpWavName$, byval Flags%) as Integer\r\n", "Code": "dim x% x% = sndPlaySound(\"C:\\win31\\tada.Wav\", 1)" }, { "Code Name": "Printer Setup", "Declerations": "Global di%\r\nDeclare Function GetProfileString% Lib \"Kernel\" (ByVal lpAppName$, ByVal lpKeyName As Any, ByVal lpDefault$, ByVal lpReturnedString$, ByVal nSize%)\r\nDeclare Function LoadLibrary% Lib \"Kernel\" (ByVal lpLibFileName$)\r\nDeclare Sub FreeLibrary Lib \"Kernel\" (ByVal hLibModule%)\r\nDeclare Function agGetStringFromLPSTR$ Lib \"\"Apiguide.dll\"\" (ByVal lpstring$)\r\nDeclare Function agDeviceMode% Lib \"\"Apiguide.dll\"\" (ByVal hWnd%, ByVal hModule%, ByVal lpszDevice$, ByVal lpszOutput$)\r\n\r\nFunction GetDefPrinter$ ()\r\n\r\nDim def$\r\ndef$ = String$(128, 0)\r\ndi% = GetProfileString%(\"\"WINDOWS\"\", \"\"DEVICE\"\", \"\"\"\", def$, 127)\r\ndef$ = agGetStringFromLPSTR$(def$)\r\nGetDefPrinter$ = def$\r\n\r\nEnd Function\r\nFunction GetDeviceDriver$ (dev$)\r\n\r\nDim firstpos%, nextpos%\r\nfirstpos% = InStr(dev$, \"\",\"\")\r\nnextpos% = InStr(firstpos% + 1, dev$, \"\",\"\")\r\nGetDeviceDriver$ = Mid$(dev$, firstpos% + 1, nextpos% - firstpos% - 1)\r\n\r\nEnd Function\r\nFunction GetDeviceName$ (dev$)\r\n\r\nDim npos%\r\nnpos% = InStr(dev$, \"\",\"\")\r\nGetDeviceName$ = Left$(dev$, npos% - 1)\r\n\r\nEnd Function\r\nFunction GetDeviceOutput$ (dev$)\r\n\r\nDim firstpos%, nextpos%\r\nfirstpos% = InStr(dev$, \"\",\"\")\r\nnextpos% = InStr(firstpos% + 1, dev$, \"\",\"\")\r\nGetDeviceOutput$ = Mid$(dev$, nextpos% + 1)\r\n\r\nEnd Function\r\n\"", "Code": "Dim dev$, devname$, devoutput$ Dim libhnd% dev$ = GetDefPrinter$() ' Get default printer info\r\n If dev$ = \"\" Then Exit Sub devname$ = GetDeviceName$(dev$)\r\n devoutput$ = GetDeviceOutput$(dev$)\r\n ' Load the device driver library - exit if unavailable\r\n libhnd% = LoadLibrary(GetDeviceDriver$(dev$) + \"\".drv\"\")\r\n If libhnd% = 0 Then Exit Sub\r\n ' WARNING - this allows change of the default printer\r\n ' settings!\r\n di% = agDeviceMode(hWnd, libhnd%, devname$, devoutput$)\r\n FreeLibrary (libhnd%)" }, { "Code Name": "Database WAV file playing", "Declerations": "Declare function sndPlaySound Lib \"MMSYSTEM\" (byval lpWavName$, byval Flags%) as Integer\r\n", "Code": "Dim x% x% = sndPlaySound(text1, 1)" }, { "Code Name": "Sound Playing WAV and MIDI", "Declerations": "Declare Function mciExecute Lib \"MMSystem\" (ByVal FileName As String) As Integer\r\n", "Code": "iResult = mciExecute(\"Play c:\\sound\\midi\\yearocat.mid\")" }, { "Code Name": "Dial a Phone Number", "Code": "PhoneNumber$ = \"(123) 456-7890\"\r\nOpen \"COM2\" For Output As #1 'or COM1\r\nPrint #1, \"ATDT\" & PhoneNumber$ & Chr$(13)\r\nClose #1\r\n\r\n" }, { "Code Name": "Moving Text", "Declerations": "Option Explicit\r\nDim Deltax, Deltay As Integer\r\n", "Code": "'TIMER CODE Sub Timer1_Timer ()\r\nPicture1.Move Picture1.Left + Deltax, Picture1.Top + Deltay\r\n\r\nIf Picture1.Left < ScaleLeft Then Deltax = 100\r\nIf Picture1.Left + Picture1.Width > ScaleWidth + ScaleLeft Then Deltax = -100\r\n'End If\r\n\r\nIf Picture1.Top < ScaleTop Then Deltay = 100\r\nIf Picture1.Top + Picture1.Height > ScaleHeight + ScaleTop Then Deltay = -100\r\n'End If\r\nEnd Sub\r\n\r\n\r\n'FORM LOAD\r\nSub Form_Load ()\r\nDeltax = 100\r\nDeltay = 100\r\nEnd Sub" }, { "Code Name": "Sounds System Beep", "Code": "For I = 1 To 3 ' Loop 3 times.\r\nBeep ' Sound a tone.\r\nNext I\r\nEnd Sub\r\n" } ] }